#ifndef AD_EXCEPTION_H_
#define AD_EXCEPTION_H_
#include <stdexcept>
#include <string>

namespace autodrive {
namespace perception {
// Base exception class
class AdException : public std::exception {
 public:
  explicit AdException(const char* what) noexcept : msg_{what} {};
  explicit AdException(std::string const& what) noexcept : msg_{what} {};
  explicit AdException(std::string&& what) noexcept : msg_{std::move(what)} {};
  ~AdException() noexcept = default;
  AdException(AdException const&) noexcept = default;
  AdException& operator=(AdException const&) noexcept = default;
  AdException(AdException&&) noexcept = default;
  AdException& operator=(AdException&&) noexcept = default;

  inline char const* what() const noexcept override { return msg_.c_str(); };

 private:
  ///@brief Exception message
  std::string msg_;
};

}  // namespace perception
}  // namespace autodrive

#endif  // !AD_EXCEPTION_H_